package com.tungse.redis_test.controller;

import com.tungse.redis_test.domain.UserDto;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private RedisTemplate redisTemplate;


    @PostMapping("/add")
    public void addUset(@RequestBody UserDto userDto) {
        redisTemplate.opsForValue().set("usera", userDto);

    }
}
